class TunnelData {
  final String tunnelId;
  final String tunnelHost;
  final String tunnelPort;
  final String publicPort;

  TunnelData({
    required this.tunnelId,
    required this.tunnelHost,
    required this.tunnelPort,
    required this.publicPort,
  });

  factory TunnelData.fromJson(Map<String, dynamic> json) {
    return TunnelData(
      tunnelId: json['tunnelId']?.toString() ?? '',
      tunnelHost: json['tunnelHost']?.toString() ?? '',
      tunnelPort: json['tunnelPort']?.toString() ?? '',
      publicPort: json['publicPort']?.toString() ?? '',
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'tunnelId': tunnelId,
      'tunnelHost': tunnelHost,
      'tunnelPort': tunnelPort,
      'publicPort': publicPort,
    };
  }

  @override
  String toString() {
    return 'TunnelData(tunnelId: $tunnelId, tunnelHost: $tunnelHost, tunnelPort: $tunnelPort, publicPort: $publicPort)';
  }
}
